<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="prc.*"%>

<jsp:include page="top.jsp" />

<%
	int cat = Integer.parseInt(request.getParameter("cat"));
	int forum = Integer.parseInt(request.getParameter("f"));
	int thread = Integer.parseInt(request.getParameter("t"));
	Categorie categorie = ForumManagement.categorii.get(cat);
	Sectiune sectiune = categorie.sectiuni.get(forum);
	boolean canPost = false;
	if(UserManagement.getCurrentUser(session) == null){
		canPost = false;
	} else {
		canPost = true;
	}
%>

<div id="page-body">
	<% if(canPost){ %>
	<h2>Post a new message</h2>
	<form action="processNewMessage.jsp?cat=<% out.print(cat); %>&f=<% out.print(forum); %>&t=<% out.print(thread); %>" method="post" id="login">
		<dl>
			<dt><label for="message">Message:</label></dt>
			<dd><textarea name="message" id="message" cols="10" rows="10" ></textarea></dd>
		</dl>
		<input type="submit" name="login" tabindex="6" value="Submit" class="button1" />
	</form>
	<% } else { %>
		Only registered users can post a new message. Please login first.
	<% } %>
</div>

<jsp:include page="bottom.jsp" />